package cn.wym.ymbill.service.impl

import cn.wym.ymbill.mapper.BillBeenMapper
import cn.wym.ymbill.model.BillBeen
import cn.wym.ymbill.service.IBillService
import org.springframework.stereotype.Service
import java.sql.SQLException
import javax.annotation.Resource

@Service("BillService")
class BillService : IBillService {

    @Resource
    val billBeenMapper: BillBeenMapper? = null

    override fun deleteByPrimaryKey(id: Int): Int {
        return billBeenMapper?.deleteByPrimaryKey(id)?: -1
    }

    override fun insert(record: BillBeen): Int {
        return billBeenMapper?.insert(record)?: -1
    }

    @Throws(SQLException::class)
    override fun insertSelective(record: BillBeen): Int {
        return billBeenMapper?.insertSelective(record)?: -1
    }

    override fun selectByPrimaryKey(id: Int): BillBeen? {
        return billBeenMapper?.selectByPrimaryKey(id)
    }

    override fun updateByPrimaryKeySelective(record: BillBeen): Int {
        return billBeenMapper?.updateByPrimaryKeySelective(record)?: -1
    }

    override fun updateByPrimaryKey(record: BillBeen): Int {
        return billBeenMapper?.updateByPrimaryKey(record)?: -1
    }
}